<table width="100%" cellpadding="0" cellspacing="0" align="center" class="product">
<?php
	if (count($products) > 0) {
	$numRows = ceil(count($products) / 3);
	$i = 0;
	for ($rows = 0; $rows < $numRows; $rows++) {
		?>
		<tr>
			<?php
			for ($cols = 0; $cols < 3; $cols++) {
				if (isset($products[$i])) {
			?>	
			<td valign="top" width="170">
				<div align="center">
				<?php
					
					echo $html->link(
						$html->image(
							IMG_URL .'products/'.  $products[$i]['Product']['img'],
							array(
								'alt'		=> $products[$i]['Product']['name'], 
								'class'		=> 'productImg',
								'width'		=> '110px;'
							)
						),
						IMG_URL .'products/'.  $products[$i]['Product']['img'],
						array(
							'title'			=> $products[$i]['Product']['name'], 
							'rel'			=> 'nofollow', 
							'escape'		=> false,
							'class'			=> 'preview'
						)
					);
					
				?>
				</div>
				<div align="center" style="padding-top:10px;">
				<?php
					echo $html->link(
						$products[$i]['Product']['name'],
						array(
							'plugin'		=> null, 
							'controller'	=> 'product', 
							'action'		=> 'detail', $products[$i]['Product']['id'],Inflector::stripUnicode($products[$i]['Product']['name']),
						),
						array(
							'title'			=> $products[$i]['Product']['name'], 
							'class'			=> 'proTitle'
						)
					);
				?><br/>
				<span style="padding-top:10px;">
					<?php
					echo $html->link(
						'Chi tiết',
						array(
							'plugin'		=> null, 
							'controller'	=> 'product', 
							'action'		=> 'detail', $products[$i]['Product']['id'],Inflector::stripUnicode($products[$i]['Product']['name'])
						),
						array(
							'title'			=> $products[$i]['Product']['name'], 
							'class'			=> 'btn_detail'
						)
					);
				?>
				</span>
				</div>
	</td>
		<?php
		$i++;
				}
	}
	?>
</tr>
<?php
	}
	}
	?>
</table>
